package com.ruibang.glass.quality.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruibang.glass.quality.config.LocalDateStringConverter;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @Author: songJinKang
 * @CreateTime: 2023-12-08  14:46
 * @Description: TODO:质量G8.7批次排序表
 * @Version: 1.0
 */
@Data
@TableName("g_quality_label")
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
public class Label implements Serializable {
    @ApiModelProperty("主键id")
    @TableId(value = "label_id", type = IdType.ASSIGN_ID)
    @ExcelIgnore
    private String labelId;
    @ApiModelProperty("托盘号")
    @ExcelProperty(value = {"水平托盘号"}, index = 1)
    @ColumnWidth(15)
    private String palletNumber;
    @ApiModelProperty("生产日期")
    @JSONField(format = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ExcelProperty(value = {"生产日期"}, index = 3,converter = LocalDateStringConverter.class)
    @ColumnWidth(11)
    private LocalDate date;
    @ApiModelProperty("品级")
    @ExcelProperty(value = {"品级"}, index = 2)
    @ColumnWidth(7)
    private String grade;
    @ApiModelProperty("发货lot")
    @ExcelProperty(value = {"发货LOT"}, index = 0)
    @ColumnWidth(15)
    private String lot;
    @ApiModelProperty("流水号")
    @ExcelProperty(value = {"流水号"}, index = 4)
    @ColumnWidth(8)
    private String serialNumber;
    @ApiModelProperty("连号")
    @ExcelProperty(value = {"连号"}, index = 5)
    @ColumnWidth(8)
    private String lh;
    @ApiModelProperty("标识号")
    @ExcelProperty(value = {"标识号"}, index = 6)
    @ColumnWidth(8)
    private String identificationNumber;
    @ApiModelProperty("二维码")
    @ExcelProperty(value = {"二维码"}, index = 7)
    @ColumnWidth(50)
    private String code;
    @ApiModelProperty("创建时间")
    @ExcelIgnore
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @ApiModelProperty("更新时间")
    @ExcelIgnore
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    @ApiModelProperty(value = "是否删除(1：是 0：否)")
    @TableLogic
    @ExcelIgnore
    private String isDelete;

}
